home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
-
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
- <xsl:output method="html"/>
-
- <xsl:variable name="common-styles">
- <style type="text/css">
- body {
- font: 140%/140% "Trebuchet MS", Tahoma, sans-serif;
- margin: 20px 30px;
- color: #004A26;
- background-color: #00C665;
- filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#C3FFE2,endColorStr=#00C665);
- }
- a { color: #007D01; }
- a:hover { color: #8A0087; }
- span.nodescription { font-size: smaller; color: #003C1E; }
- div.newspapertitle {
- font-size: larger;
- text-transform: uppercase;
- font-weight: bold;
- margin-bottom: 16px;
- border-bottom: 3px solid #008A47;
- }
- div.newsitemfooter { font-size: x-small; font-style: italic; }
- div.newsitemtitle {
- font-weight: bold;
- }
- blockquote { font-style: italic; }
- div.newsitemcontent {
- margin-top: 20px;
- }
- hr.newsitembreak {
- color: #008A47; height: 1px; margin-top: 30px; margin-bottom: 30px;
- }
- div.newsitembreak {
- border-top: 1px dotted #008A47;
- margin: 24px 0;
- }
- </style>
- </xsl:variable>
-
- <!-- channel group -->
- <xsl:template match="newspaper[@type='group']">
- <html>
- <head>
- <title>Group Newspaper</title>
- <xsl:copy-of select="$common-styles"/>
- <style type="text/css">
- div.channelnewsitems {
- border: 1px solid #008A47;
- padding: 8px 12px;
- margin-bottom: 12px;
- }
- div.channeltitle {
- border: 1px solid #008A47;
- border-bottom: none;
- font-weight: bold;
- text-transform: uppercase;
- text-align: center;
- }
- </style>
- </head>
- <body>
- <xsl:variable name="newspapertype" select="@type"/>
- <xsl:if test="title">
- <div class="newspapertitle">
- <xsl:value-of select="title" disable-output-escaping="yes"/>
- </div>
- </xsl:if>
-
- <xsl:for-each select="channel">
- <div class="channeltitle">
- <xsl:value-of select="title"/>
- </div>
- <div class="channelnewsitems">
- <xsl:for-each select="item">
- <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
- <xsl:apply-templates select="."/>
- <div class="newsitembreak"></div>
- </xsl:for-each>
- </div>
- </xsl:for-each>
- </body>
- </html>
- </xsl:template>
-
- <!-- news item and channel -->
- <xsl:template match="newspaper[@type='newsitem' or @type='channel']">
- <html>
- <head>
- <title>Newspaper</title>
- <xsl:copy-of select="$common-styles"/>
- </head>
- <body>
- <xsl:variable name="newspapertype" select="@type"/>
- <xsl:if test="title">
- <div class="newspapertitle">
- <xsl:value-of select="title" disable-output-escaping="yes"/>
- </div>
- </xsl:if>
-
- <xsl:for-each select="channel/item">
- <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
- <xsl:apply-templates select="."/>
- <xsl:if test="$newspapertype != 'newsitem'">
- <div class="newsitembreak"></div>
- </xsl:if>
- </xsl:for-each>
- </body>
- </html>
- </xsl:template>
-
- <!-- news item template -->
- <xsl:template match="item">
- <div class="newsitem">
- <div class="newsitemtitle">
- <xsl:variable name="itemlink" select="link"/>
- <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
- </div>
- <div class="newsitemfooter">
- <xsl:variable name="srclink" select="source/@htmlUrl"/>
- <xsl:value-of select="fd:dateDisplay"/> | <a href="{$srclink}"><xsl:value-of select="source"/></a>
- <!-- add link to comments if available -->
- <xsl:if test="comments">
- <xsl:variable name="commentlink" select="comments"/>
- <xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
- | <a href="{$commentlink}"><img src="{$commentimg}" border="0" align="absmiddle" hspace="6"/></a>
- </xsl:if>
- <!-- add link to enclosure if available -->
- <xsl:if test="enclosure">
- <xsl:variable name="enclosurelink" select="enclosure/@url"/>
- <xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
- | <a href="{$enclosurelink}"><img src="{$enclosureimg}" align="absmiddle" border="0" hspace="6"/></a>
- </xsl:if>
- </div>
- <div class="newsitemcontent">
- <xsl:value-of select="description" disable-output-escaping="yes"/>
- </div>
- </div>
- </xsl:template>
-
- </xsl:stylesheet>